package com.lwc.cfdns.enums;

/**
 * 异常枚举
 *
 * @author luwc
 * @title BaseErrorEnum
 * @description
 * @time 2023/4/24 17:24:47
 * @version: 1.0
 */
public enum ResultCode implements IResultCode {
    SUCCESS(200, "成功"),
    SUCCESS_NOT_DATA_FOUNT(200, "条件查不到数据"),
    ERROR(400, "系统错误!"),
    NOT_DATA_FOUNT(400, "记录不存在"),
    NOT_FOUNT(404, "资源不存在"),
    AUTH_ERROR(401, "token验证失败,请重新登录"),
    AUTH_TOKEN_ERROR(401, "token验证失败,请重新登录"),
    AUTH_UNAUTHORIZED(401, "token验证失败,请重新登录"),
    AUTH_FORBIDDEN(403, "没有权限!"),
    AUTH_PWD_ERROR(400, "登录密码错误!"),
    AUTH_PWD_LOGIN(400, "登录账号或密码错误了!"),
    AUTH_TOKEN_NULL(401, "token不能为空");

    private int code;
    private String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}

interface IResultCode {
    int getCode();

    String getMessage();
}
